<?php
namespace app\admin\model;

use think\Model;
use think\model\concern\SoftDelete;

class AuthGroup extends Model
{
    use SoftDelete;
    protected $pk = 'id';
    protected $deleteTime = 'delete_time';
    public static function authGroup()
    {
        $list = AuthGroup::select()->toArray();
        return $list;
    }
    public static function authGroupAdd($add)
    {
        try{
            $res = AuthGroup::strict(true)->save($add);
            $msg = "添加成功";
        }catch (\Exception $e){
            $res = false;
            $msg = "添加失败";
        }
        return [$res,$msg];
    }
    public static function authGroupEdit($edit)
    {
        try{
            $res = AuthGroup::update($edit);
            $msg = "修改成功";
        }catch (\Exception $e){
            $res = false;
            $msg = "修改失败";
        }
        return [$res,$msg];
    }
    public static function authGroupDel($get)
    {
        try{
            $res = AuthGroup::destroy($get['id']);
            $msg = '删除成功';
        }catch (\Exception $e){
            $res = false;
            $msg = '删除失败';
        }
        return [$res,$msg];
    }






}